#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2022/11/2 18:12
# @Author : 闫峰
# @File    : utils.py
import hashlib
import time

def url_parse(value):
    """
    编码
    :param value:   要编码的字符串
    :return:
    """
    import urllib
    from urllib import parse
    # URL编码
    new_txt = urllib.parse.quote(value)
    return  new_txt

def md5_encryption(value):
    """ md5 加密"""
    str_md5 = hashlib.md5(str(value).encode(encoding='utf-8')).hexdigest()
    return str_md5


def set_time():
    localtime = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
    return  localtime + " +0800"

